*Document summarizing analysis for Staton and Romero


***************************************************************
*clarify what is happening here. 

// You will need to install eclplot, parmest, gllamm, and sencode
***************************************************************


clear

//Define your path. 

	local main_dir /Users/jkstato/Dropbox/Research/Current Projects/IACHR Spring 2016/Replication Files //Your main directory
	local file final_remedy.dta

cd "`main_dir'"
use "`file'", clear
set logtype text
log using "remedy_log", replace

//1. 	Table 1	
		tab clear compliance if compliance<2, row //Table 1 top panel
		tab clear prob, row //Table 1 bottom panel

//2.	Intercoder reliability	(fn 8)
		kap  remedyclarity remedyclarity2 if compliance<2 & uncertain2<99 //
	

//3.	Models summarized in Figure 1 and Table 1 of Appendix (plus files needed to create Figure 1)
		//For the models using clarity variable coded by Unblinded coder
			//Model 1
			use "`file'", clear
			xi: gllamm compliance clear hrscores mcjud_conf if compliance<2, robust family(binomial) link(logit) i(casenum statenum) nip(8)
				parmest, saving("modelclear.dta", replace)
		
				//Panel for Figure 1
				use "modelclear.dta",clear
				sencode parm, gen(parmid)
				label define id 1 "Clear Order" 2 "Human Rights Context" 3 "Judicial Confidence" 4 "Constant"
				label values parmid id
				keep in 1/4
				eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-6(2)6) ylabel(1(1)4) ytitle("") rplottype(rspike) title("Pr(Compliance=1)")xline(0) scheme(s1mono)
				graph save "g1", replace

			//Model 2
			use "`file'", clear
			xi: gllamm prob clear hrscores mcjud_conf, robust family(binomial) link(logit) i(casenum statenum) nip(8)
				parmest, saving("modelprob.dta", replace)
				
				//Panel for Figure 1
				use "modelprob.dta",clear
				sencode parm, gen(parmid)
					label define id 1 "Clear Order" 2 "Human Rights Context" 3 "Judicial Confidence" 4 "Constant"
					label values parmid id
				keep in 1/4
				eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-6(2)6) ylabel(1(1)4) ytitle("") rplottype(rspike) title("Pr(Resistance=1)")xline(0) scheme(s1mono)
				graph save "g2", replace


			//Model 3
			use "`file'", clear
				xi: gllamm clear uncertain2 hrscores if uncertain2<99, robust family(binomial) link(logit) i(casenum statenum) nip(8)
					parmest, saving("modelclarity.dta", replace)

				//Panel for Figure 1
				use "modelclarity.dta",clear
				sencode parm, gen(parmid)
				keep in 1/3
					label define id 1 "Uncertain policy area" 2 "Human Rights Context" 3 "Constant"
					label values parmid id
				eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-6(2)6) ylabel(1(1)3) ytitle("") rplottype(rspike) title("Pr(Clarity = 1)")xline(0) scheme(s1mono) 
				graph save "g3", replace

				//Create combined figure unblinded coder side (left) of Figure 1
					gr combine "g3" "g1" "g2", row(3) scheme(s1mono) title(Unblinded Coder)
					gr save "model1summary", replace
					graph export "model1summary.pdf", replace



			//Now, fit models using the clarity variable coded by the Blinded coder
			*Model 1
			use "`file'", clear
			xi: gllamm compliance clear2 hrscores mcjud_conf if compliance<2, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			parmest, saving("modelclear2.dta", replace)

				//Panel for Figure 1
				use "modelclear2.dta",clear
				sencode parm, gen(parmid)
					label define id 1 "Clear Order" 2 "Human Rights Context" 3 "Judicial Confidence" 4 "Constant"
					label values parmid id
				keep in 1/4
				eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-6(2)6) ylabel(1(1)4) ytitle("") rplottype(rspike) title("Pr(Compliance=1)")xline(0) scheme(s1mono)
				graph save "g12", replace

			//Model 2
			use "`file'", clear
			xi: gllamm prob clear2 hrscores mcjud_conf, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			parmest, saving("modelprob2.dta", replace)

				//Panel for Figure 1
				use "modelprob2.dta",clear
				sencode parm, gen(parmid)
					label define id 1 "Clear Order" 2 "Human Rights Context" 3 "Judicial Confidence" 4 "Constant"
					label values parmid id
				keep in 1/4
				eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-6(2)6) ylabel(1(1)4) ytitle("") rplottype(rspike) title("Pr(Resistance=1)")xline(0) scheme(s1mono)
				graph save "g22", replace

			//Model 3
			use "`file'", clear
			xi: gllamm clear2 uncertain2 hrscores if uncertain2<99, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			parmest, saving("modelclarity2.dta", replace)

				//Panel for Figure 1
				use "modelclarity2.dta",clear
				sencode parm, gen(parmid)
				keep in 1/3
					label define id 1 "Uncertain policy area" 2 "Human Rights Context" 3 "Constant"
					label values parmid id
				eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-6(2)6) ylabel(1(1)3) ytitle("") rplottype(rspike) title("Pr(Clarity = 1)")xline(0) scheme(s1mono) 
				graph save "g32", replace

	
				//Complete Figure 1
				gr combine "g32" "g12" "g22", row(3) scheme(s1mono) title(Blinded Coder)
				gr save "model1summary_withclear2", replace
				graph export "model1summary_withclear2.pdf", replace


				gr combine "model1summary" "model1summary_withclear2", col(2) scheme(s1mono) 
				gr save "total", replace
				gr export "total.pdf", replace	//This is Figure 1		
					
					
					
					
//4. 	Table 2 														
use "`file'", clear
	xi: gllamm compliance clear hrscores mcjud_conf if compliance<2, robust family(binomial) link(logit) i(casenum statenum) nip(8)
		set seed 812357
		drawnorm comp_b1-comp_b6, n(2000) means(e(b)) cov(e(V)) clear /*Draw 2000 parameters from MVN(beta,sigma^2)*/
		gen comp_case=rnormal(-.112, .553)
		gen comp_state=rnormal(.98, .553)
			rename comp_b1 comp_clear
			rename comp_b2 comp_hr
			rename comp_b3 comp_mcj
			rename comp_b4 comp_constant
		drop comp_b5 comp_b6	
		gen obs=_n 
		save "/Users/jkstato/Dropbox/Research/Current Projects/IACHR Spring 2016/analysis_april_18/comp_draws", replace
		
		clear
		use "`file'", clear
		xi: gllamm clear uncertain2 hrscores if uncertain2<99, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			set seed 910309
			drawnorm comp_b1-comp_b5, n(2000) means(e(b)) cov(e(V)) clear /*Draw 2000 parameters from MVN(beta,sigma^2)*/
				gen clar_case=rnormal(.336, .288)
				gen clar_state=rnormal(.0001, .0001)
				rename comp_b1 clar_unc
				rename comp_b2 clar_hr
				rename comp_b3 clar_constant
				drop comp_b4 comp_b5
				gen obs=_n
				merge 1:1 obs using "/Users/jkstato/Dropbox/Research/Current Projects/IACHR Spring 2016/analysis_april_18/comp_draws"
				
		save "all_draws", replace
		
	*Now set up values of IVs
		use "all_draws", clear
		gen clear1=1
			gen clear0=0
			gen uncertain1=1
			gen uncertain0=0
			gen hr=.06
			gen mcjud=0
		
	*Now set linear predictors that we need
		gen clar_unc1 = clar_unc+ clar_hr*hr + clar_constant+clar_case+clar_state  /*Clarity when uncertainty=1*/
		gen clar_unc0 = clar_hr*hr + clar_constant+clar_case+clar_state  /*Clarity when uncertainty=0*/
		
		gen comp_clear1 = comp_clear+comp_hr*hr+comp_mcj*0+comp_constant+comp_case+comp_state 	/*Compliance when clarity=1*/	
		gen comp_clear0 = comp_hr*hr+comp_mcj*0+comp_constant+comp_case+comp_state 	/*Compliance when clarity=0*/	
				
		gen pr_clear_unc1=invlogit(clar_unc1) /*Pr(Clear=1 | uncertainty=1)*/
		gen pr_clear_unc0=invlogit(clar_unc0) /*Pr(Clear=1 | uncertainty=0)*/
		
		gen pr_comp_clear1=invlogit(comp_clear1) /*Pr(Compliance=1 | uncertainty=1)*/
		gen pr_comp_clear0=invlogit(comp_clear0) /*Pr(Compliance=1 | uncertainty=0)*/			

		gen pr_comp_unc1=(pr_clear_unc1*pr_comp_clear1)+((1-pr_clear_unc1)*pr_comp_clear0) /*This Pr(Clear=1)*Pr(Compliance=1|Clear=1)+ Pr(Clear=0)*Pr(Compliance=1|Clear=0)|Uncertain=1 */
		sum  pr_comp_unc1 /* Estimate of Pr(Compliance|Uncertainty=1) */
		_pctile pr_comp_unc1, p(2.5, 97.5)
		return list
		
		gen pr_comp_unc0=(pr_clear_unc0*pr_comp_clear1)+((1-pr_clear_unc0)*pr_comp_clear0) /*This Pr(Clear=1)*Pr(Compliance=1|Clear=1)+ Pr(Clear=0)*Pr(Compliance=1|Clear=0)|Uncertain=0 */
		sum  pr_comp_unc0 /* Estimate of Pr(Compliance|Uncertainty=1) */
		_pctile pr_comp_unc0, p(2.5, 97.5)
		return list
		
		gen diff_unc=pr_comp_unc1- pr_comp_unc0 /*This is the difference between the two probabilities of compliance*/
		sum  diff_unc  /*This is the expected difference*/
		_pctile diff_unc, p(2.5, 97.5) /*This captures the 95% CI of the difference */
		return list /*This lists the 95% CI */
		
		//This part is for completeness. It is not reported in the paper. It reports the simulation based estimates of the effect of uncertainty on clarity. 
		gen diff_clarity_uncertain=pr_clear_unc1-pr_clear_unc0 /*This is the difference between the two probabilities of clear for two values of uncertain*/
		sum diff_clarity_uncertain /*This reports the difference*/
		_pctile diff_clarity_uncertain, p(2.5, 97.5) /*This captures the 95% CI */
		return list /*This lists the 95% CI */
		
	/*Notes: 
	a. The median intercept for the case equaion was -.112 -- this is for Case 33, Palarma Iribarne v. Chile. The variance of
	this estimate is .553. The state for this intercept is Chile -- and its intercept is .98; Variance=.553
	
	b. For the clarity equation, the case intercept is .052 and its variance is .309 and the state intercept for Chile is .0001. and it's variance is .0001 */
	

			
			
//5. 	Figure 2 and Table 6 in Appendix

use "`file'", clear

		// Base model plus NGO and XConst Measure
		xi: gllamm compliance clear hrscores mcjud_conf ngonum xconst2 if compliance<2, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			parmest, saving("alternatives1.dta", replace)
	
		use "alternatives1.dta",clear
			sencode parm, gen(parmid)
			keep in 1/5
				label define id 1 "Clear Order" 2 "Human Rights Context" 3 "Judicial Confidence" 4 "NGO Support" 5 "Exec. Constraints" 6 "Constant"
				label values parmid id
			eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-10(2)10) ylabel(1(1)5) ///
			ytitle("") rplottype(rspike) title("Pr(Compliance=1)")xline(0) scheme(s1mono)  title(Model 1)
			graph save "alt1", replace
		
		// Base model plus LJI		
		use "`file'", clear
		xi: gllamm compliance clear hrscores mcjud_conf lji if compliance<2, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			parmest, saving("alternatives2.dta", replace)
		
		use "alternatives2.dta",clear
			sencode parm, gen(parmid)
			keep in 1/4
				label define id 1 "Clear Order" 2 "Human Rights Context" 3 "Judicial Confidence" 4 "Judicial Independence" 5 "Constant"
				label values parmid id
			eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-10(2)10) ylabel(1(1)4) ytitle("") ///
			rplottype(rspike) title("Pr(Compliance=1)")xline(0) scheme(s1mono) title(Model 2)
			graph save "alt2", replace
		
		// Base plus Bureaucratic Quality
		use "`file'", clear
		xi: gllamm compliance clear hrscores mcjud_conf i.burquality if compliance<2, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			parmest, saving("alternatives3.dta", replace)
		
		use "alternatives3.dta",clear
			sencode parm, gen(parmid)
			keep in 1/5
				label define id 1 "Clear Order" 2 "Human Rights Context" 3 "Judicial Confidence" 4 "Med. Bureaucratic Quality" 5 "High Bureaucratic Quality" 6 "Constant"
				label values parmid id
			eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-10(2)10) ylabel(1(1)5) ytitle("") rplottype(rspike) ///
			title("Pr(Compliance=1)")xline(0) scheme(s1mono) title(Model 3)
			graph save "alt3", replace
		
		// Combine graphs to make Figure 2
			gr combine "alt1" "alt2" "alt3" ,row(3) scheme(s1mono) title(Alternative Models of Compliance)
			gr save "alt_combine", replace	
			gr export "alt_combine.pdf", replace // This is Figure 2. 
	
	
// 6. Figure 3 (Including the Uncertainty measure in the second equation)

		use "`file'", clear
		xi: gllamm compliance clear hrscores mcjud_conf uncertain2 if compliance<2&uncertain2<99, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			parmest, saving("modelclear_uncertain.dta", replace)
		
		use "modelclear_uncertain.dta",clear
		sencode parm, gen(parmid)
			label define id 1 "Clear Order" 2 "Human Rights Context" 3 "Judicial Confidence" 4 "Uncertain Policy Context" 5 "Constant"
			label values parmid id
		keep in 1/5
			eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-6(2)6) ylabel(1(1)5) ytitle("") ///
			rplottype(rspike) title("Pr(Compliance=1)")xline(0) scheme(s1mono) 
			graph save "g1_uncertain", replace
		
			gr combine "g1" "g1_uncertain", row(2) scheme(s1mono)
			gr save "Comparison with including uncertain in second equation", replace
			gr export "Comparison with including uncertain in second equation.pdf", replace  //This is Figure 3
	
//7. 	Table 3

		use "`file'", clear
		xi: gllamm compliance clear hrscores mcjud_conf uncertain2 if compliance<2&uncertain2<99, robust family(binomial) link(logit) i(casenum statenum) nip(8)
		set seed 84020809
		drawnorm comp_b1-comp_b7, n(2000) means(e(b)) cov(e(V)) clear /*Draw 2000 parameters from MVN(beta,sigma^2)*/
		gen comp_case=rnormal(-.128, .674)
		gen comp_state=rnormal(1.24, .663)
			rename comp_b1 comp_clear
			rename comp_b2 comp_hr
			rename comp_b3 comp_mcj
			rename comp_b4 comp_uncertain
			rename comp_b5 comp_constant
		drop comp_b6 comp_b7	
		gen obs=_n 
		save "comp_draws_uncinboth", replace
		
		clear
		use "`file'", clear
		xi: gllamm clear uncertain2 hrscores if uncertain2<99, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			set seed 18417909
			drawnorm comp_b1-comp_b5, n(2000) means(e(b)) cov(e(V)) clear /*Draw 2000 parameters from MVN(beta,sigma^2)*/
				gen clar_case=rnormal(.336, .288)
				gen clar_state=rnormal(.0001, .0001)
				rename comp_b1 clar_unc
				rename comp_b2 clar_hr
				rename comp_b3 clar_constant
				drop comp_b4 comp_b5
				gen obs=_n
				merge 1:1 obs using "comp_draws_uncinboth"
				
		save "all_draws_uncinboth", replace
		
	*Now set up values of IVs
		use "all_draws_uncinboth", clear
			gen clear1=1
			gen clear0=0
			gen uncertain1=1
			gen uncertain0=0
			gen hr=.48
			gen mcjud=0
		
	*Now set linear predictors that we need
		gen clar_unc1 = clar_unc+ clar_hr*hr + clar_constant+clar_case+clar_state  /*Clarity when uncertainty=1*/
		gen clar_unc0 = clar_hr*hr + clar_constant+clar_case+clar_state  /*Clarity when uncertainty=0*/
		
		gen comp_clear1_unc1 = comp_clear+comp_hr*hr+comp_mcj*0+comp_uncertain+comp_constant+comp_case+comp_state 	/*Compliance when clear=1&uncertain=1*/
		gen comp_clear0_unc1 = comp_hr*hr+comp_mcj*0+comp_uncertain+comp_constant+comp_case+comp_state 	/*Compliance when clear=0&uncertain=1*/
		gen comp_clear1_unc0 = comp_clear+comp_hr*hr+comp_mcj*0+comp_constant+comp_case+comp_state 	/*Compliance when clear=1&uncertain=0*/
		gen comp_clear0_unc0 = comp_hr*hr+comp_mcj*0+comp_constant+comp_case+comp_state 	/*Compliance when clear=0&uncertain=0*/

		
		gen pr_clear_unc1=invlogit(clar_unc1) /*Pr(Clear=1 | uncertainty=1)*/
		gen pr_clear_unc0=invlogit(clar_unc0) /*Pr(Clear=1 | uncertainty=0)*/
		
		gen pr_comp_clear11=invlogit(comp_clear1_unc1) /*Pr(Compliance=1 | clear=1 & uncertainty=1)*/
		gen pr_comp_clear01=invlogit(comp_clear0_unc1) /*Pr(Compliance=1 | clear=0 & uncertainty=1)*/
		gen pr_comp_clear10=invlogit(comp_clear1_unc0) /*Pr(Compliance=1 | clear=1 & uncertainty=0)*/
		gen pr_comp_clear00=invlogit(comp_clear0_unc0) /*Pr(Compliance=1 | clear=0 & uncertainty=0)*/
		
		
		gen pr_comp_unc1=(pr_clear_unc1*pr_comp_clear11)+((1-pr_clear_unc1)*pr_comp_clear01) /*This Pr(Clear=1)*Pr(Compliance=1|Clear=1)+ Pr(Clear=0)*Pr(Compliance=1|Clear=0)|Uncertain=1 */
		sum  pr_comp_unc1 /* Estimate of Pr(Compliance|Uncertainty=1) */
		_pctile pr_comp_unc1, p(2.5, 97.5)
		return list
		
		gen pr_comp_unc0=(pr_clear_unc0*pr_comp_clear10)+((1-pr_clear_unc0)*pr_comp_clear00) /*This Pr(Clear=1)*Pr(Compliance=1|Clear=1)+ Pr(Clear=0)*Pr(Compliance=1|Clear=0)|Uncertain=0 */
		sum  pr_comp_unc0 /* Estimate of Pr(Compliance|Uncertainty=1) */
		_pctile pr_comp_unc0, p(2.5, 97.5)
		return list
		
		gen diff_unc= pr_comp_unc1 - pr_comp_unc0  /*This is the difference between the two probabilities of compliance*/
		sum diff_unc
		_pctile diff_unc, p(2.5, 97.5) /*This captures the 95% CI */
		return list /*This lists the 95% CI */
		
		gen diff_clarity_uncertain=pr_clear_unc1-pr_clear_unc0 /*This is the difference between the two probabilities of clear for two values of uncertain. Not reported in paper.*/
		sum diff_clarity_uncertain /*This reports the difference*/
		_pctile diff_clarity_uncertain, p(2.5, 97.5) /*This captures the 95% CI */
		return list /*This lists the 95% CI */

		
	/*Notes: In this model, the median for the  the case intercept was -.128 -- this is for Case 33, Palamara Iribarne v. Chile. The variance of
	this estimate is .674. The state for this intercept is Chile -- and its intercept is 1.24; Variance=.663
	
	For the clarity equation, the case intercept is .052 and its variance is .309 and the state intercept for Chile is .0001. and it's variance is .0001 */
	
	
	
//8.	Table 4
		//Model in which orders are nested within remedy types
		use "`file'", clear

		gllamm clear hrscores if uncertain2<99, robust family(binomial) link(logit) i(remedynature ) nip(8)
		gllapred int, u
	
		tab remedynature if m1<0
		tab remedynature if m1>0
		/*This information in the tabulation are used to create Table 4. Here is how the type of remedies were coded: 
		remedynature - The nature of the remedy. Does the remedy deal with money damages. The codes are as follows. 
			1	monetary remuneration (non-pecuniary)
			2	Publication of decision
			3	Undertake criminal proceeding
			4	Change/modify a law
			5	Public act/Acknowledge responsibility
			6 	Release information/find or return bodies
			7	Implement programming
			8 	Investigate and try those responsible
			9	Non-monetary restitution
			10	Monetary remuneration (pecuniary damages)
			11	Strike criminal conviction from record
			12	Sponsor scholarship
			13	Other */			
						

						
*******************************************************************
*All material from here is found in the Appendix. There are a few *
*results in the appendix that are found above. 					  *
*******************************************************************

// 8. 	Linear probability model with fixed effects for remedy types
	
		use "`file'", clear
		
		xi: reg compliance clear i.remedynature  if compliance<2&uncertain2<99, cluster(casenum)

		xi: reg compliance clear i.remedynature hrscores mcjud_conf if compliance<2&uncertain2<99, cluster(casenum)
		
// 9. 	Exluding orders to investigate crimes (Figure 4)

		use "`file'", clear

		*First Model 
		xi: gllamm compliance clear hrscores mcjud_conf if compliance<2&remedynature~=8, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			parmest, saving("modelclear_noinvestigate.dta", replace)
		
		use "modelclear_noinvestigate.dta",clear
			sencode parm, gen(parmid)
				label define id 1 "Clear Order" 2 "Human Rights Context" 3 "Judicial Confidence" 4 "Constant"
				label values parmid id
			keep in 1/4
			eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-6(2)6) ylabel(1(1)4) ytitle("") rplottype(rspike) ///
			title("Pr(Compliance=1)")xline(0) scheme(s1mono)
			graph save "g1_noinvest", replace

		*Second Model 
		use "`file'", clear
		xi: gllamm prob clear hrscores mcjud_conf if remedynature~=8, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			parmest, saving("modelprob_noinvestigate.dta", replace)

		use "modelprob_noinvestigate.dta",clear
			sencode parm, gen(parmid)
				label define id 1 "Clear Order" 2 "Human Rights Context" 3 "Judicial Confidence" 4 "Constant"
				label values parmid id
			keep in 1/4
			eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-6(2)6) ylabel(1(1)4) ytitle("") rplottype(rspike) title("Pr(Resistance=1)")xline(0) scheme(s1mono)
			graph save "g2_noinvest", replace


		*Third Model 
		use "`file'", clear
		xi: gllamm clear uncertain2 hrscores if uncertain2<99 &remedynature~=8, robust family(binomial) link(logit) i(casenum statenum) nip(8)
			parmest, saving("modelclarity_noinvestigate.dta", replace)
	
		use "modelclarity_noinvestigate.dta",clear
			sencode parm, gen(parmid)
			keep in 1/3
				label define id 1 "Uncertain policy area" 2 "Human Rights Context" 3 "Constant"
				label values parmid id
			eclplot estimate min95 max95 parmid, hori xtitle(Estimate) xlabel(-6(2)6) ylabel(1(1)3) ytitle("") rplottype(rspike) title("Pr(Clarity = 1)")xline(0) scheme(s1mono) 
			graph save "g3_noinvest", replace
	
	
		*Create Figure 4
		gr combine "g3_noinvest" "g1_noinvest" "g2_noinvest", row(3) scheme(s1mono) title(Excluding orders to investigate)
		gr save "model1summary_noinvest", replace
		graph export "model1summary_noinvest.pdf", replace //This is the right side of Figure 4


		*Now combine originals with this. 
	
			gr combine "g3" "g1" "g2", row(3) scheme(s1mono) title(All Observations)
			gr save "model1summary_compare", replace
	
			gr combine "model1summary_compare" "model1summary_noinvest", col(2) scheme(s1mono)
			gr save "Comparison with No Investigations", replace
			gr export "comparison_no_investigations.pdf", replace //This is Figure 4. 


//10. 	Checking Word Count and Clarity Coding

		use "`file'", clear
		ttest remedywordcount, by(clear)

log close
